package kr.hkit.powerjava.chapter06.work2;

import java.util.Scanner;

public class CopyOfWork01 {

	private int n;
	private int price;

	public CopyOfWork01(int n) {
		this.n = n;
		
	}
	
	void setData(int n) {
		this.n = n;
	}
	

	public int getPrice() {
		int n = 0; // 개수
		Scanner input = new Scanner(System.in);
		int price = 0; // 값

		/*System.out.print("물건의 개수를 입력하시오.");
		n = input.nextInt();*/

		if (n >= 100) {
			price = (int) (n * 100 * 0.8);
		} else {
			if (n >= 20) {
				price = (int) (n * 100 * 0.85);
			} else {
				if (n >= 10) {
					price = (int) (n * 100 * 0.9);
				} else {
					price = n * 100;
				}
			}
		}
		return price;
	}

	@Override
	public String toString() {
		return "할인된 물건의 가격은: [n=" + n + ", getPrice=" + getPrice() + "]";
	}

}
